<template>
	<view class="content">
		<view class="body">
			<view class="body_title" @click="yugao">
				<image src="../../static/img/common/shuangcengyuandian.png" mode=""></image>
				<text>直播预告</text>
				{{info.next_time||""}}
			</view>

			<view class="body_pic">
				<u-swiper :list="list1" height="314"></u-swiper>
			</view>

			<view class="btn">
				<view class="btn_list">
					<view class="btn_list_left" @click="todizhi()">
						视频号正在直播
					</view>
					<image src="../../static/img/index/youjiantou.png" mode=""></image>
				</view>
				
				<view class="btn_list">
					<view class="btn_list_left" @click="tozhuye()">
						进入视频号主页
					</view>
					<image src="../../static/img/index/youjiantou.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list1: [],
				images:[],
				info:{},
				shipinhaoid:"",
				zhiboid:""
			}
		},
		onLoad() {

		},
		onShow() {
			this.zhiboinfo()
		},
		methods: {
			todizhi(){
				// 注意需要在真机调试查看sph3CJXFMtdcak3
				wx.getChannelsLiveInfo ({
					finderUserName:this.info.current_url,
					startTime:0,
					success(res){
						console.log(JSON.stringify(res))
						if(res.status==2){ 
							wx.openChannelsLive({
								finderUserName:this.info.current_url,
								feedId:res.feedId,
								nonceId:res.nonceId,
								success(res){
									console.log(JSON.stringify(res))
								},
								fail(res) {
									console.log(JSON.stringify(res))
								}
							})
						}else{
							uni.showToast({
								title:"直播未开始",
								icon:"none"
							})
						}
						
					},
					fail(res){
						console.log(JSON.stringify(res))
					}
					
				})
			},
			yugao(){
				wx.openChannelsActivity({
					finderUserName: this.info.main_url,
					feedId: 'export/UzFfAgtgekIEAQAAAAAAh3My0K4xJgAAAAstQy6ubaLX4KHWvLEZgBPE14EMbRkwbb-GzNPgMJp2A4whmfr8YBm5icxffYzk',
					success(res) {
						console.log(res)
					}
				})
			},
			tozhuye(){
				wx.openChannelsUserProfile({
					finderUserName: this.info.current_url,
					success(res) {
						console.log(res)
					},
					fail(res){
						console.log(JSON.stringify(res))
					}
				})
			},
			zhiboinfo() {
				let params = {
					user_id: uni.getStorageSync('user_info').user_id,
					token: uni.getStorageSync('user_info').token
				}
				this.$http.getJson('index_shipinhao', params, "POST").then(res => {
					console.log(JSON.stringify(res))
					this.list1=res.data.images.split(",")
					console.log(this.images)
					this.info=res.data
					
				})
			},
		}
	}
</script>

<style lang="scss">
	.content {
		min-height: 100vh;
		background: #F5F7FB;
		padding-bottom: 0;
		overflow: hidden;
	}

	.body {
		padding: 38rpx 30rpx;

		.body_title {
			display: flex;
			align-items: center;
			font-size: 26rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #E71F19;

			image {
				width: 42rpx;
				height: 42rpx;
			}

			text {
				margin: 0 28rpx;
				font-size: 34rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #E71F19;
			}

		}

		.body_pic {
			margin-top: 24rpx;
		}
	}


	.btn {
		margin-top: 30rpx;

		.btn_list {
			width: 688rpx;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 14rpx;
			.btn_list_left {
				font-size: 34rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #333333;
				display: flex;
				align-items: center;
			}
			image{
				width: 20rpx;
				height: 30rpx;
			}
		}
	}
</style>